package com.b2.controller.wx;

import com.b2.pojo.entity.Video;
import com.b2.result.Result;
import com.b2.service.VideoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/wx/Video")
@Slf4j
@Api(tags = "视频资源相关接口")
@CrossOrigin
public class WxVideoController {

    // 注入VideoService接口对象
    @Resource
    private VideoService videoService;

    @PostMapping("/list")
    @ApiOperation("根据课程id查询视频")
    public Result<List<Video>> pageList(@ApiParam("课程id") @RequestParam(name = "courseId") Long courseId) {
        return videoService.listAll(courseId);
    }
}
